<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@include file="/WEB-INF/page/share/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改个人信息</title>
<link rel="stylesheet" href="/shop/css/index/index.css" media="all" type="text/css"/>
<link rel="stylesheet" href="/shop/css/buyer/person.css" media="all" type="text/css"/>
<script type="text/javascript" language="javascript">
	function submitform(){
		var form = document.forms[0];
		if(validate(form)){
			form.submit();
		}
	}

	function validate(form){
		if(form.nickname.value == ""){
			alert("妮称不能为空!");
			return false;
		}
		if(form.email.value == ""){
			alert("邮箱地址不能为空!");
			return false;
		}
		var emailvalue = form.email.value;
		if(!validateEmail_(emailvalue))
			return false;
		if(form.gender.value == ""){
			alert("请选择性别!");
			return false;
		}
		if(form.address.value == ""){
			alert("联系地址不能为空!");
			return false;
		}
		if(form.phone.value == "" && form.mobile.value == ""){
			alert("手机号码或座机号码至少要填一个!");
			return false;
		}
		if(!validatePhonenumber(form.phone.value)){
			return false;
		}
		return true;
	}
	
	function validateEmail_(email_){
	    //alert("validateEmail");
       //对电子邮件的验证
        var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
      	if(!myreg.test(email_)){
            alert('提示\n\n请输入有效的E_mail！');
            return false;
       	}
     	return true;
    }
    
    function validatePhonenumber(phonenumber){
    	//alert("validatePhonenumber");
    	var mobile1=/^(13+\d{9})|(15+\d{9})$/;
    	if(!mobile1.test(phonenumber))
        {
            alert('提示\n\n请输入有效的电话号码！');
            return false;
       }
        return true;
    }
    
</script>
</head>
<body>
<div class="container">
      <jsp:include page="/WEB-INF/page/share/Head.jsp" />
     <div class="middle">
     	<div class="nav">
         	<div class="item">
             	<div class="item_l">●</div>
                 <div class="item_m"><a href="/shop">去首页</a></div>
                 <div class="item_r"></div>
             </div>
             <div class="item_line"></div>
             <div class="item">
             	<div class="item_l">●</div>
                 <div class="item_m"><a href ="/shop/shopping/cart.do">我的购物车</a></div>
                 <div class="item_r"></div>
             </div>
             <div class="item_line"></div>
             <div class="item">
             	<div class="item_l">●</div>
                 <div class="item_m"><a href = "/shop/front/user/manage.do?method=mychengzi">我已下的订单</a></div>
                 <div class="item_r"></div>
             </div>
             <div class="item_line"></div>
             <div class="item">
             	<div class="item_l">●</div>
                 <div class="item_m"><a href="/shop/front/user/manage.do?method=show">我的个人信息</a></div>
                 <div class="item_r"></div>
             </div>
         </div>
     <html:form action="/front/user/manage" method="post">
     	<input type="hidden" name="method" value="edit"></input>
         <div class="person">
         	<div class="person_header">
             	<div class="person_title">我的个人信息</div>
             </div>
             <div class="person_content">
             	<div class="pc_l">
                 	<div class="pc_photo"><img src="/shop/image/buyer/person_photo.png"/></div>
                     <div class="pc_send_btn"><img src="/shop/image/buyer/person_send_btn.png"/></div>
                 </div>
                 <div class="pc_line"></div>
                 <div class="pc_r">
                 	
                     <div class="pc_h">
                     	<div class="pc_h_l">昵称:</div>
                         <div class="pc_h_r"><html:text property="nickname" value="${buyer.nickname }"/>&nbsp;&nbsp;<font color="red">*&nbsp;&nbsp;${requestScope.nickname_null }</font></div>
                     </div>
                     <div class="pc_h">
                     	<div class="pc_h_l">真实姓名:</div>
                         <div class="pc_h_r"><html:text property="realname" value="${buyer.realname }"/></div>
                     </div>
                     <div class="pc_h">
                     	<div class="pc_h_l">邮箱:</div>
                         <div class="pc_h_r"><html:text property="email" value="${buyer.email }"/>&nbsp;&nbsp;<font color="red">*&nbsp;&nbsp;${requestScope.email_null }</font></div>
                     </div>
                     <div class="pc_h">
                     	<div class="pc_h_l">性别:</div>
                         <div class="pc_h_r"><html:radio property="gender" value="MAN"/>男
     						<html:radio property="gender" value="WOMEN"/>女&nbsp;&nbsp;<font color="red">*&nbsp;&nbsp;${requestScope.gender_null }</font></div>
                     </div>
                     <div class="pc_p"><font>已下是您的联系信息:</font></div>
                     <div class="pc_h">
                     	<div class="pc_h_l">联系地址:</div>
                         <div class="pc_h_r"><html:text property="address" value="${buyer.contactInfo.address }"/>&nbsp;&nbsp;<font color="red">*&nbsp;&nbsp;${requestScope.address_null }</font></div>
                     </div>
                     <div class="pc_h">
                     	<div class="pc_h_l">邮编:</div>
                         <div class="pc_h_r"><html:text property="postalcode" value="${buyer.contactInfo.postalcode }"/></div>
                     </div>
                     <div class="pc_h">
                     	<div class="pc_h_l">座机:</div>
                         <div class="pc_h_r"><html:text property="phone" value="${buyer.contactInfo.phone }"/></div>
                     </div>
                     <div class="pc_h">
                     	<div class="pc_h_l">手机:</div>
                         <div class="pc_h_r"><html:text property="mobile" value="${buyer.contactInfo.mobile }"/>&nbsp;&nbsp;<font color="red">*&nbsp;&nbsp;<c:if test="${!empty requestScope.nickname_null }">${requestScope.nickname_null }</c:if></font></div>
                     </div>
                     <div class="btn"><img src="/shop/image/confirm/modify_btn.png" border="0" style="cursor: hand;" alt="提交修改" onclick="javascript:submitform()"/></div>
                 </div>
             </div>
         </div>
         </html:form>
     </div><!-- end middle -->
     <!-- 中间部分结束 -->
     <div class="footer"><img src="/shop/image/footer_img.png"/></div><!--end footer-->
     </div>
</body>
</html>